Format of DataTrak Log File ============================ ============================ Byte b[i] Count Contents Remarks ========================================================================== 12-byte log file header one time each log file at the beginning: ---------------------------------------------------------------- 00-05 6 Headerbytes 6 unknown bytes 06-07 2 Count of dives = b[0] + b[1] * 256 08-11 4 Headerbytes 4 unknown bytes Supposition: metrical: DC 05 FA 00 saturation: imperial: 64 00 14 00 not changed : 64 00 14 00 1. dive: -------- 12-13 2 dive header 2 unknown bytes 14-16 3 date explanation further down 17 1 time zone explanation further down 18-19 2 time explanation further down 20-... 1 lenLoc count of bytes of location lenLoc location of dive - 1 lenPla count of bytes of place lenPla place of dive - 1 height over sea level explanation further down 2 intervall (time between dives) explanation further down 1 weather explanation further down 2 air temperature = (b[0] + b[1] * 256 ) / 100 1 suit explanation further down 2 size of tank = (b[0] + b[1] * 256 ) / 100 2 max. depths = (b[0] + b[1] * 256 ) / 100 2 duration of dive explanation further down 2 water temperature = (b[0] + b[1] * 256 ) / 100 2 air consumption = (b[0] + b[1] * 256 ) / 100 2 diving type explanation further down 2 actions explanation further down 1 lenAct count of bytes of further actions lenAct further actions - 1 lenPar count of bytes of partner lenPar partners of dive - 1 lenCom count of bytes of comment lenCom comment of dive - 2 alarm explanation further down 2 number of dive = b[0] + b[1] * 256 12 unknown 12 unknown bytes byte 6+7 saturation after calculation 2 lenPro count of bytes of profile data = b[0] + b[1] * 256 lenPro profile datga explanation further down 1 end mark=0 date: ===== x = (long)256L * 256L * b[2] + 256 * b[1] + b[0]; year = (int)(1600.0 + (4.0 * x / 1461.0)); x = x - (long)(((jahr-1600.0) / 4.0) * 1461.0) + (int)((x/36525L)+1); BEGIN: month=1; if(x>31.0) { month=2; day=(int)x; x -= 31.0; } else { goto END; } if(x>28.0) { month=3; day=(int)x; x -= 28.0; } else { goto END; } if(x>31.0) { month=4; day=(int)x; x -= 31.0; } else { goto END; } if(x>30.0) { month=5; day=(int)x; x -= 30.0; } else { goto END; } if(x>31.0) { month=6; day=(int)x; x -= 31.0; } else { goto END; } if(x>30.0) { month=7; x -= 30.0; } else { goto END; } if(x>31.0) { month=8; x -= 31.0; } else { goto END; } if(x>31.0) { month=9; x -= 31.0; } else { goto END; } if(x>30.0) { month=10; x -= 30.0; } else { goto END; } if(x>31.0) { month=11; x -= 31.0; } else { goto END; } if(x>30.0) { month=12; x -= 30.0; } else { goto END; } if(x>31.0) { month=1; x -= 31; goto BEGIN; } END: day=(int)x; day--; That function doesn't work correct sometimes during change of year, don't know why. With the following fit it works better: if(day==0 && month==1) { day=31; month=12; } if(month==1) { if(day<=3) { year++; } } time zone: ========== unknown time: ===== x=b[0] + b[1] * 256 hour = x / 60 minute = x % 60 height over sea surface: ======================== 1 = 0000-0900m 2 = 0900-1750m intervall (rest between two dives): =================================== x=b[0] + b[1] * 256 hour = x / 60 minute = x % 60 weather: ======== 1 = clear 2 = cloudy 3 = fog 4 = rain 5 = storm 6 = snow suit: ===== 1 = no suit 2 = shorty 3 = combi 4 = wet 5 = half dry 6 = dry duration of dive: ================= x=b[0] + b[1] * 256 hour = x / 60 minute = x % 60 dive type: ========== x=b[0] + b[1] * 256 Bit 0 is set in x: - Bit 1 is set in x: - Bit 2 is set in x: no deco Bit 3 is set in x: deco Bit 4 is set in x: single up Bit 5 is set in x: multi up Bit 6 is set in x: sweet water Bit 7 is set in x: salt water Bit 8 is set in x: nitrox actions: ======== x=b[0] + b[1] * 256 Bit 0 is set in x: fun Bit 1 is set in x: club Bit 2 is set in x: training Bit 3 is set in x: instruktion Bit 4 is set in x: night Bit 5 is set in x: cave Bit 6 is set in x: ice Bit 7 is set in x: search Bit 8 is set in x: wreck Bit 9 is set in x: river Bit 10 is set in x: current Bit 11 is set in x: photo Alarm: ====== x=b[0] + b[1] * 256 Bit 0 is set in x: too fast diving up Bit 1 is set in x: - Bit 2 is set in x: - Bit 3 is set in x: deco Bit 4 is set in x: power Bit 5 is set in x: SOS Bit 6 is set in x: - Bit 7 is set in x: - profile data: ============= Each 20 seconds is made one measure point of depths. Each measure point needs 2 bytes. Within one minute 1 byte is needed for deco information. --> one minute will need 7 bytes. --> if nitrox dive, the measure points start 2 bytes later. no nitrox dive: --------------- 0-21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 ... Byte [----] [----] [----] [] [----] [----] [----] [] unknown depth1 depth2 depth3 | depth4 depth5 depth6 | deco byte deco byte is unknown is unknown ntrox dive: ----------- 0-23 24 25 26 27 28 29 30 31 32 33 34 35 64 37 ... Byte [----] [----] [----] [] [----] [----] [----] [] unknown depth1 depth2 depth3 | depth4 depth5 depth6 | deco byte deco byte is unknown is unknown depth: x = (b[0] * 4 ) + ((b[1] & 0xC0) / 64) depth = (x * 160.0 ) / 1024.0 general infos: -------------- b[0] + b[1] * 256 means the following (for example see count of dives): 06-07 2 Count of dives = b[0] + b[1] * 256 count of dive = multiply byte 7 (b[1]) with 256 and add byte 6 (b[0] 0xC0 means hexadezimal value C0 & and-operation